<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
	//response.sendRedirect("common/login");
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${path }/resource/css/lire.css" />
<script type="text/javascript" src="${path }/resource/js/jquery-2.0.3.js"></script>
<script type="text/javascript" src="${path }/resource/js/ajaxfileupload.js"></script>
<style type="text/css">
.ipt_photo {
	z-index: 1;
	position: absolute;
	right: 11px;
	top: 50%;
	margin-top: -8px;
	height: 16px;
	width: 18px;
	cursor: pointer;
	background-color: #FFF;
	background-image:
		url(${path }/resource/bootstrap/img/soutu_icons_6eead741.png);
	background-repeat: no-repeat;
	background-position: 0px 0px;
}


</style>
<script>
    var openFile = function () {
    	alert("jjj");
    	/* var file=document.getElementById("sfpt").files[0];
        var input = event.target;  
        var reader = new FileReader();
        reader.readAsDataURL(file); 
        reader.onload = function () {
            var database64 = getBase64Image(reader.result);
            $.ajax({  
                url: "${path}/developer/lire/search",  
                type: "POST",  
                data: { "date": database64 },  
                success: function (data) {
                	alert("jjja");
                   // var url = data["data"];  
                    //$("#user_img").attr("src", url);  
                }  
            });  
             
        };  
        reader.readAsDataURL(input.files[0]);  
    	*/ 
    	$.ajaxFileUpload({
    		url: "${path}/developer/lire/search",  
            type: "POST", 
            secureuri : false,// 一般设置为false
            fileElementId : "sfpt",
			dataType : "json",
			success : function(data) {
				
			}
    });
    }
    function getBase64Image(imgElem) {  
        return imgElem.replace(/^data:image\/(jpeg|jpg);base64,/, "");}  
</script>
</head>
<body>
	<!-- <div id="search">
		<input type="text" id="txt" placeholder="必败的国际大牌">
		<label for="txt" id="message">必败的国际大牌</label>
		<button>搜索</button>
	</div> -->
	<br>
	
<form enctype="multipart/form-data" method="post">
	<span class="bg s_ipt_wr quickdelete-wrap"> 
		<span class="soutu-btn"><input class="spt" id ="sfpt" name="sf" value="上传图片" type="file" onchange='openFile(event)'></span>
		<input id="kw" name="wd" class="s_ipt"
		value="" maxlength="255" autocomplete="off"> 
		<a style="top: 0px; right: 0px; display: none;" class="quickdelete"
		title="清空" id="quickdelete" href="javascript:;"></a>
	</span>
	<span class="bg s_btn_wr"><input id="su" value="百度一下"
		class="bg s_btn" type="submit"></span>
		</form>
		<img src="file:///D|/test/image/item_pic3.jpg" id="user_img" />
</body>
</html>